<?php

namespace App\Utils\Traits;

use App\Utils\Base\FilterBase;
use Doctrine\ORM\QueryBuilder;

/**
 * Trait FilterTrait
 * @package App\Utils\Traits
 */
trait FilterTrait {
    /**
     * 过滤
     * @param FilterBase $filter
     * @return QueryBuilder
     */
    public function filter (FilterBase $filter): QueryBuilder {
        return $filter->apply($this->createQueryBuilder(FilterBase::ALIAS));
    }
}